import { defineStore } from 'pinia';
import { getUserInfo } from '../api/user';

export const useUserStore = defineStore('user', {
  state: () => ({
    userInfo: null
  }),
  actions: {
    async getUserInfoAction() {
      try {
        const userInfo = await getUserInfo();
        this.userInfo = userInfo;
        return userInfo;
      } catch (error) {
        return null;
      }
    }
  }
}); 